<?php
//So linh vuc hien thi tren mot trang
$v_limit = CONST_LIMIT_AF_PAGE ;
$v_min = CONST_MIN;	//Xac dinh so lan xem nho nhat
if(isset($_REQUEST['page'])){
	$page=$_REQUEST['page'];
}
else
	$page=1;

if(_is_sqlserver()){
	$sql = "Exec ONEGATE_HostestAfCount " ;
	$sql = $sql .$v_min ;
	$result = @mssql_query($sql,$conn);	
	$arr_count = _get_row_to_array($result);

	$v_total_af_count = $arr_count['0']['0'];

	$pager  = Pager::getPagerData($v_total_af_count, $v_limit, $page);
	$page   = $pager->page;
  	$offset = $pager->offset +1; 
  	$limit = $pager->limit;

	//Lay danh sach TTHC
	$sql = "ONEGATE_HostestAfGetAll  ";
	$sql = $sql . $offset;
	$sql = $sql .",". $limit;
	$sql = $sql .",". $v_min;
	$result = @mssql_query($sql,$conn);	
	$arr_all_af_hostes = _get_row_to_array($result);
}?>